<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__system.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">System<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for interacting with reset and delays. </p>
<h1><a class="anchor" id="section_system_features"></a>
Features</h1>
<p >This driver provides three categories of functionality:</p><ul>
<li>Ability to get the last reset reason.</li>
<li>Ability to delay for a period of time.</li>
<li>The ability to disable interrupts during a critical section.</li>
</ul>
<h1><a class="anchor" id="subsection_system_quickstart"></a>
Quick Start</h1>
<ul>
<li><a class="el" href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43">cyhal_system_critical_section_enter</a> and <a class="el" href="group__group__hal__system.html#ga9fe83f08f46b64c956ec7ed3c335f659">cyhal_system_critical_section_exit</a> are used to enable/disable global interrupts</li>
<li><a class="el" href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a> and <a class="el" href="group__group__hal__system.html#ga25235eff5e6695bfdcc9943e7095a83b">cyhal_system_delay_us</a> are delay functions used to halt the CPU exectution for a specified period of time</li>
<li><a class="el" href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">cyhal_system_get_reset_reason</a> gets the cause of latest system reset and <a class="el" href="group__group__hal__system.html#ga9a935d5e4f43343e7bbb4f9a86a10df0">cyhal_system_clear_reset_reason</a> clears the reset cause registers</li>
</ul>
<h1><a class="anchor" id="subsection_system_codesnippet"></a>
Code Snippets</h1>
<h2><a class="anchor" id="subsection_system_snippet1"></a>
Snippet 1: Critical Section</h2>
<p >Critical section is a portion in the code where all active interrupts are disabled. This is usually provided in places where the code execution must not be disturbed by an interrupt. An example is a firmware controlled communication protocol where timing of each byte must be maintained and any interrupt might cause loss of data. <br  />
 <a class="el" href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43">cyhal_system_critical_section_enter</a> returns the current state of interrupts which denote the active interrupts in the system. This must be passed as argument to <a class="el" href="group__group__hal__system.html#ga9fe83f08f46b64c956ec7ed3c335f659">cyhal_system_critical_section_exit</a> while exiting the critical section. </p><div class="fragment"><div class="line">    <span class="comment">// Disables all interrupts</span></div>
<div class="line">    uint32_t state = <a class="code hl_function" href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43">cyhal_system_critical_section_enter</a>();</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Application code where interrupts must be disabled</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Re-enable all interrupts that were enabled before</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__system.html#ga9fe83f08f46b64c956ec7ed3c335f659">cyhal_system_critical_section_exit</a>(state);</div>
<div class="ttc" id="agroup__group__hal__system_html_ga70a306e5108a38aa995c0ab7d0147e43"><div class="ttname"><a href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43">cyhal_system_critical_section_enter</a></div><div class="ttdeci">uint32_t cyhal_system_critical_section_enter(void)</div><div class="ttdoc">Enter a critical section.</div></div>
<div class="ttc" id="agroup__group__hal__system_html_ga9fe83f08f46b64c956ec7ed3c335f659"><div class="ttname"><a href="group__group__hal__system.html#ga9fe83f08f46b64c956ec7ed3c335f659">cyhal_system_critical_section_exit</a></div><div class="ttdeci">void cyhal_system_critical_section_exit(uint32_t old_state)</div><div class="ttdoc">Exit a critical section.</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_system_snippet2"></a>
Snippet 2: Reset reason</h2>
<p ><a class="el" href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">cyhal_system_get_reset_reason</a> must be called at the beginning of the main to determine the reason for reset. The return parameters are present in <a class="el" href="group__group__hal__system.html#ga53ba6a7416574a1b03890d23b7a90264">cyhal_reset_reason_t</a>. </p><div class="fragment"><div class="line">    <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079">CYHAL_SYSTEM_RESET_WDT</a> == <a class="code hl_function" href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">cyhal_system_get_reset_reason</a>())</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// WDT caused system reset</span></div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Application code to perform some action to indicate that WDT caused the interrupt</span></div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Clear the reset reason</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__system.html#ga9a935d5e4f43343e7bbb4f9a86a10df0">cyhal_system_clear_reset_reason</a>();</div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Reset reason is not WDT Could be POR or XRES.  Specify application code to perform some</span></div>
<div class="line">        <span class="comment">// action to indicate WDT was not the reset reaon</span></div>
<div class="line">    }</div>
<div class="ttc" id="agroup__group__hal__system_html_ga9a7b601e0b06a896860f411103a4abc6"><div class="ttname"><a href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">cyhal_system_get_reset_reason</a></div><div class="ttdeci">cyhal_reset_reason_t cyhal_system_get_reset_reason(void)</div><div class="ttdoc">Gets the cause of the latest reset or resets that occurred in the system.</div></div>
<div class="ttc" id="agroup__group__hal__system_html_ga9a935d5e4f43343e7bbb4f9a86a10df0"><div class="ttname"><a href="group__group__hal__system.html#ga9a935d5e4f43343e7bbb4f9a86a10df0">cyhal_system_clear_reset_reason</a></div><div class="ttdeci">void cyhal_system_clear_reset_reason(void)</div><div class="ttdoc">Clears the reset cause registers.</div></div>
<div class="ttc" id="agroup__group__hal__system_html_gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079"><div class="ttname"><a href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079">CYHAL_SYSTEM_RESET_WDT</a></div><div class="ttdeci">@ CYHAL_SYSTEM_RESET_WDT</div><div class="ttdoc">A watchdog timer (WDT) reset has occurred.</div><div class="ttdef"><b>Definition:</b> cyhal_system.h:104</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__system"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__system.html">SYSTEM HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__system"><td class="mdescLeft">&#160;</td><td class="mdescRight">SYSTEM specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gaa60625daf3efd10f83a90b0032b4a818"><td class="memItemLeft" align="right" valign="top"><a id="gaa60625daf3efd10f83a90b0032b4a818" name="gaa60625daf3efd10f83a90b0032b4a818"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_irq_handler</b>) (void)</td></tr>
<tr class="memdesc:gaa60625daf3efd10f83a90b0032b4a818"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function pointer for IRQ handlers ( <a class="el" href="group__group__hal__system.html#ga208f2774fd0143000cea9e488035c337">cyhal_system_set_isr</a>). <br /></td></tr>
<tr class="separator:gaa60625daf3efd10f83a90b0032b4a818"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga53ba6a7416574a1b03890d23b7a90264"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga53ba6a7416574a1b03890d23b7a90264">cyhal_reset_reason_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a95a4c3cce365341fe7bca673720a2d93">CYHAL_SYSTEM_RESET_NONE</a> = 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079">CYHAL_SYSTEM_RESET_WDT</a> = 1 &lt;&lt; 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264aa852e5ed7f6785de64f75f6d8f0a2994">CYHAL_SYSTEM_RESET_ACTIVE_FAULT</a> = 1 &lt;&lt; 1
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264adf8b1ade858c21843b064b7bb9d1ad74">CYHAL_SYSTEM_RESET_DEEPSLEEP_FAULT</a> = 1 &lt;&lt; 2
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a27e1581bf176b0b216c7bb9266a88a2d">CYHAL_SYSTEM_RESET_SOFT</a> = 1 &lt;&lt; 3
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a2d37ff7de305fafa5efd82851b10f9f8">CYHAL_SYSTEM_RESET_HIB_WAKEUP</a> = 1 &lt;&lt; 4
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a9f7bc88bd31996816b0c87e66b6ed3ab">CYHAL_SYSTEM_RESET_WCO_ERR</a> = 1 &lt;&lt; 5
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a47ca71b4cbbccce8cce116e61d5054c0">CYHAL_SYSTEM_RESET_SYS_CLK_ERR</a> = 1 &lt;&lt; 6
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264a2ed57102eaf30e7b73e04b380d8abe10">CYHAL_SYSTEM_RESET_PROTECTION</a> = 1 &lt;&lt; 7
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#gga53ba6a7416574a1b03890d23b7a90264aa830cecbee70100de8bac92a52975c52">CYHAL_SYSTEM_RESET_WARMBOOT</a> = 1 &lt;&lt; 8
<br />
 }</td></tr>
<tr class="memdesc:ga53ba6a7416574a1b03890d23b7a90264"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flags enum of possible system reset causes.  <a href="group__group__hal__system.html#ga53ba6a7416574a1b03890d23b7a90264">More...</a><br /></td></tr>
<tr class="separator:ga53ba6a7416574a1b03890d23b7a90264"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafeea1420fd2da9fe4f00a182a083e57c"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#gafeea1420fd2da9fe4f00a182a083e57c">cyhal_system_voltage_supply_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#ggafeea1420fd2da9fe4f00a182a083e57caf5c399ada3960bb3f5e6784be9bdccc9">CYHAL_VOLTAGE_SUPPLY_VDDA</a> = 0u
, <br />
&#160;&#160;<a class="el" href="group__group__hal__system.html#ggafeea1420fd2da9fe4f00a182a083e57ca072774e669a76b4999d596b27bf897b0">CYHAL_VOLTAGE_SUPPLY_MAX</a> = CYHAL_VOLTAGE_SUPPLY_VDDA
<br />
 }</td></tr>
<tr class="memdesc:gafeea1420fd2da9fe4f00a182a083e57c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Supply voltages whose levels can be specified and queried via <a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a> and <a class="el" href="group__group__hal__system.html#ga1ceb538fd488a22132ab2153280ade6b">cyhal_system_get_supply_voltage</a>, respectively.  <a href="group__group__hal__system.html#gafeea1420fd2da9fe4f00a182a083e57c">More...</a><br /></td></tr>
<tr class="separator:gafeea1420fd2da9fe4f00a182a083e57c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga70a306e5108a38aa995c0ab7d0147e43"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43">cyhal_system_critical_section_enter</a> (void)</td></tr>
<tr class="memdesc:ga70a306e5108a38aa995c0ab7d0147e43"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enter a critical section.  <a href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43">More...</a><br /></td></tr>
<tr class="separator:ga70a306e5108a38aa995c0ab7d0147e43"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9fe83f08f46b64c956ec7ed3c335f659"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga9fe83f08f46b64c956ec7ed3c335f659">cyhal_system_critical_section_exit</a> (uint32_t old_state)</td></tr>
<tr class="memdesc:ga9fe83f08f46b64c956ec7ed3c335f659"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exit a critical section.  <a href="group__group__hal__system.html#ga9fe83f08f46b64c956ec7ed3c335f659">More...</a><br /></td></tr>
<tr class="separator:ga9fe83f08f46b64c956ec7ed3c335f659"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5f450769c1207d98134a9ced39adfdda"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a> (uint32_t milliseconds)</td></tr>
<tr class="memdesc:ga5f450769c1207d98134a9ced39adfdda"><td class="mdescLeft">&#160;</td><td class="mdescRight">Requests that the current operation delays for at least the specified length of time.  <a href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">More...</a><br /></td></tr>
<tr class="separator:ga5f450769c1207d98134a9ced39adfdda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga25235eff5e6695bfdcc9943e7095a83b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga25235eff5e6695bfdcc9943e7095a83b">cyhal_system_delay_us</a> (uint16_t microseconds)</td></tr>
<tr class="memdesc:ga25235eff5e6695bfdcc9943e7095a83b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Requests that the current operation delay for at least the specified number of micro-seconds.  <a href="group__group__hal__system.html#ga25235eff5e6695bfdcc9943e7095a83b">More...</a><br /></td></tr>
<tr class="separator:ga25235eff5e6695bfdcc9943e7095a83b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9a7b601e0b06a896860f411103a4abc6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__hal__system.html#ga53ba6a7416574a1b03890d23b7a90264">cyhal_reset_reason_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">cyhal_system_get_reset_reason</a> (void)</td></tr>
<tr class="memdesc:ga9a7b601e0b06a896860f411103a4abc6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the cause of the latest reset or resets that occurred in the system.  <a href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">More...</a><br /></td></tr>
<tr class="separator:ga9a7b601e0b06a896860f411103a4abc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9a935d5e4f43343e7bbb4f9a86a10df0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga9a935d5e4f43343e7bbb4f9a86a10df0">cyhal_system_clear_reset_reason</a> (void)</td></tr>
<tr class="memdesc:ga9a935d5e4f43343e7bbb4f9a86a10df0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the reset cause registers.  <a href="group__group__hal__system.html#ga9a935d5e4f43343e7bbb4f9a86a10df0">More...</a><br /></td></tr>
<tr class="separator:ga9a935d5e4f43343e7bbb4f9a86a10df0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga85e89acd2a95fc589999ad9a6f20d48d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga85e89acd2a95fc589999ad9a6f20d48d">cyhal_system_reset_device</a> (void)</td></tr>
<tr class="memdesc:ga85e89acd2a95fc589999ad9a6f20d48d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the device.  <a href="group__group__hal__system.html#ga85e89acd2a95fc589999ad9a6f20d48d">More...</a><br /></td></tr>
<tr class="separator:ga85e89acd2a95fc589999ad9a6f20d48d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga208f2774fd0143000cea9e488035c337"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga208f2774fd0143000cea9e488035c337">cyhal_system_set_isr</a> (int32_t irq_num, int32_t irq_src, uint8_t priority, <a class="el" href="group__group__hal__system.html#gaa60625daf3efd10f83a90b0032b4a818">cyhal_irq_handler</a> handler)</td></tr>
<tr class="memdesc:ga208f2774fd0143000cea9e488035c337"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers the specified handler as the callback function for the specified irq_num with the given priority.  <a href="group__group__hal__system.html#ga208f2774fd0143000cea9e488035c337">More...</a><br /></td></tr>
<tr class="separator:ga208f2774fd0143000cea9e488035c337"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2338e3ad7fac5762523f4f5c473c86a3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a> (<a class="el" href="group__group__hal__system.html#gafeea1420fd2da9fe4f00a182a083e57c">cyhal_system_voltage_supply_t</a> supply, uint32_t mvolts)</td></tr>
<tr class="memdesc:ga2338e3ad7fac5762523f4f5c473c86a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Informs the system of the current voltage level on the specified supply.  <a href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">More...</a><br /></td></tr>
<tr class="separator:ga2338e3ad7fac5762523f4f5c473c86a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1ceb538fd488a22132ab2153280ade6b"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__system.html#ga1ceb538fd488a22132ab2153280ade6b">cyhal_system_get_supply_voltage</a> (<a class="el" href="group__group__hal__system.html#gafeea1420fd2da9fe4f00a182a083e57c">cyhal_system_voltage_supply_t</a> supply)</td></tr>
<tr class="memdesc:ga1ceb538fd488a22132ab2153280ade6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the current voltage level on the specified supply, as set in <a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a>.  <a href="group__group__hal__system.html#ga1ceb538fd488a22132ab2153280ade6b">More...</a><br /></td></tr>
<tr class="separator:ga1ceb538fd488a22132ab2153280ade6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga53ba6a7416574a1b03890d23b7a90264" name="ga53ba6a7416574a1b03890d23b7a90264"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga53ba6a7416574a1b03890d23b7a90264">&#9670;&nbsp;</a></span>cyhal_reset_reason_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__system.html#ga53ba6a7416574a1b03890d23b7a90264">cyhal_reset_reason_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Flags enum of possible system reset causes. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264a95a4c3cce365341fe7bca673720a2d93" name="gga53ba6a7416574a1b03890d23b7a90264a95a4c3cce365341fe7bca673720a2d93"></a>CYHAL_SYSTEM_RESET_NONE&#160;</td><td class="fielddoc"><p >No cause. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079" name="gga53ba6a7416574a1b03890d23b7a90264a28d2eb1bf90f731f930c487d8dcd8079"></a>CYHAL_SYSTEM_RESET_WDT&#160;</td><td class="fielddoc"><p >A watchdog timer (WDT) reset has occurred. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264aa852e5ed7f6785de64f75f6d8f0a2994" name="gga53ba6a7416574a1b03890d23b7a90264aa852e5ed7f6785de64f75f6d8f0a2994"></a>CYHAL_SYSTEM_RESET_ACTIVE_FAULT&#160;</td><td class="fielddoc"><p >The fault logging system requested a reset from its Active logic. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264adf8b1ade858c21843b064b7bb9d1ad74" name="gga53ba6a7416574a1b03890d23b7a90264adf8b1ade858c21843b064b7bb9d1ad74"></a>CYHAL_SYSTEM_RESET_DEEPSLEEP_FAULT&#160;</td><td class="fielddoc"><p >The fault logging system requested a reset from its Deep-Sleep logic. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264a27e1581bf176b0b216c7bb9266a88a2d" name="gga53ba6a7416574a1b03890d23b7a90264a27e1581bf176b0b216c7bb9266a88a2d"></a>CYHAL_SYSTEM_RESET_SOFT&#160;</td><td class="fielddoc"><p >The CPU requested a system reset through it's SYSRESETREQ. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264a2d37ff7de305fafa5efd82851b10f9f8" name="gga53ba6a7416574a1b03890d23b7a90264a2d37ff7de305fafa5efd82851b10f9f8"></a>CYHAL_SYSTEM_RESET_HIB_WAKEUP&#160;</td><td class="fielddoc"><p >A reset has occurred due to a a wakeup from hibernate power mode. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264a9f7bc88bd31996816b0c87e66b6ed3ab" name="gga53ba6a7416574a1b03890d23b7a90264a9f7bc88bd31996816b0c87e66b6ed3ab"></a>CYHAL_SYSTEM_RESET_WCO_ERR&#160;</td><td class="fielddoc"><p >A reset has occurred due to a watch-crystal clock error. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264a47ca71b4cbbccce8cce116e61d5054c0" name="gga53ba6a7416574a1b03890d23b7a90264a47ca71b4cbbccce8cce116e61d5054c0"></a>CYHAL_SYSTEM_RESET_SYS_CLK_ERR&#160;</td><td class="fielddoc"><p >A reset has occurred due to a system clock error. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264a2ed57102eaf30e7b73e04b380d8abe10" name="gga53ba6a7416574a1b03890d23b7a90264a2ed57102eaf30e7b73e04b380d8abe10"></a>CYHAL_SYSTEM_RESET_PROTECTION&#160;</td><td class="fielddoc"><p >A reset has occurred due to a protection violation. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga53ba6a7416574a1b03890d23b7a90264aa830cecbee70100de8bac92a52975c52" name="gga53ba6a7416574a1b03890d23b7a90264aa830cecbee70100de8bac92a52975c52"></a>CYHAL_SYSTEM_RESET_WARMBOOT&#160;</td><td class="fielddoc"><p >A reset has occurred due wake up from DSRAM, which is a Warm Boot. </p>
</td></tr>
</table>

</div>
</div>
<a id="gafeea1420fd2da9fe4f00a182a083e57c" name="gafeea1420fd2da9fe4f00a182a083e57c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafeea1420fd2da9fe4f00a182a083e57c">&#9670;&nbsp;</a></span>cyhal_system_voltage_supply_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__system.html#gafeea1420fd2da9fe4f00a182a083e57c">cyhal_system_voltage_supply_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Supply voltages whose levels can be specified and queried via <a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a> and <a class="el" href="group__group__hal__system.html#ga1ceb538fd488a22132ab2153280ade6b">cyhal_system_get_supply_voltage</a>, respectively. </p>
<dl class="section note"><dt>Note</dt><dd>Not all supplies which are present are included here. This enum only contains the voltage supplies whose values are relevant to the operation of one or more HAL drivers. </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggafeea1420fd2da9fe4f00a182a083e57caf5c399ada3960bb3f5e6784be9bdccc9" name="ggafeea1420fd2da9fe4f00a182a083e57caf5c399ada3960bb3f5e6784be9bdccc9"></a>CYHAL_VOLTAGE_SUPPLY_VDDA&#160;</td><td class="fielddoc"><p >VDDA - Analog supply voltage. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggafeea1420fd2da9fe4f00a182a083e57ca072774e669a76b4999d596b27bf897b0" name="ggafeea1420fd2da9fe4f00a182a083e57ca072774e669a76b4999d596b27bf897b0"></a>CYHAL_VOLTAGE_SUPPLY_MAX&#160;</td><td class="fielddoc"><p >Alias for the highest value in this enum. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga70a306e5108a38aa995c0ab7d0147e43" name="ga70a306e5108a38aa995c0ab7d0147e43"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga70a306e5108a38aa995c0ab7d0147e43">&#9670;&nbsp;</a></span>cyhal_system_critical_section_enter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_system_critical_section_enter </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enter a critical section. </p>
<p >Disables interrupts and returns a value indicating whether the interrupts were previously enabled.</p>
<dl class="section return"><dt>Returns</dt><dd>Returns the state before entering the critical section. This value must be provided to <a class="el" href="group__group__hal__system.html#ga9fe83f08f46b64c956ec7ed3c335f659">cyhal_system_critical_section_exit()</a> to properly restore the state</dd></dl>
<p>See <a class="el" href="group__group__hal__system.html#subsection_system_snippet1">Snippet 1: Critical Section</a> for code snippet on critical section </p>

</div>
</div>
<a id="ga9fe83f08f46b64c956ec7ed3c335f659" name="ga9fe83f08f46b64c956ec7ed3c335f659"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9fe83f08f46b64c956ec7ed3c335f659">&#9670;&nbsp;</a></span>cyhal_system_critical_section_exit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_system_critical_section_exit </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>old_state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Exit a critical section. </p>
<p >Re-enables the interrupts if they were enabled before <a class="el" href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43" title="Enter a critical section.">cyhal_system_critical_section_enter()</a> was called. The argument should be the value returned from <a class="el" href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43">cyhal_system_critical_section_enter()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">old_state</td><td>The state of interrupts from <a class="el" href="group__group__hal__system.html#ga70a306e5108a38aa995c0ab7d0147e43" title="Enter a critical section.">cyhal_system_critical_section_enter()</a></td></tr>
  </table>
  </dd>
</dl>
<p>See <a class="el" href="group__group__hal__system.html#subsection_system_snippet1">Snippet 1: Critical Section</a> for code snippet on critical section </p>

</div>
</div>
<a id="ga5f450769c1207d98134a9ced39adfdda" name="ga5f450769c1207d98134a9ced39adfdda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5f450769c1207d98134a9ced39adfdda">&#9670;&nbsp;</a></span>cyhal_system_delay_ms()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_system_delay_ms </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>milliseconds</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Requests that the current operation delays for at least the specified length of time. </p>
<p >If this is running in an RTOS aware environment (COMPONENTS+=RTOS_AWARE) or (DEFINES+=CY_RTOS_AWARE) it will attempt to have the RTOS suspend the current task so others can continue to run. If this is not run under an RTOS it will then defer to the standard system delay which is likely to be a busy loop. If this is part of an application that is build with RTOS awareness, but the delay should not depend on the RTOS for whatever reason, use <a class="el" href="group__group__hal__system.html#ga25235eff5e6695bfdcc9943e7095a83b" title="Requests that the current operation delay for at least the specified number of micro-seconds.">cyhal_system_delay_us()</a> with the appropriate 1000x multiplier to the delay time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">milliseconds</td><td>The number of milliseconds to delay for </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns CY_RSLT_SUCCESS if the delay request was successful, otherwise error </dd></dl>

</div>
</div>
<a id="ga25235eff5e6695bfdcc9943e7095a83b" name="ga25235eff5e6695bfdcc9943e7095a83b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga25235eff5e6695bfdcc9943e7095a83b">&#9670;&nbsp;</a></span>cyhal_system_delay_us()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_system_delay_us </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>microseconds</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Requests that the current operation delay for at least the specified number of micro-seconds. </p>
<p >This will generally keep the processor active in a loop for the specified length of time. If this is running under an RTOS, it will NOT attempt to run any other RTOS tasks, however if the scheduler or a high priority interrupt comes it they can take over anyway.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">microseconds</td><td>The number of micro-seconds to delay for </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga9a7b601e0b06a896860f411103a4abc6" name="ga9a7b601e0b06a896860f411103a4abc6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9a7b601e0b06a896860f411103a4abc6">&#9670;&nbsp;</a></span>cyhal_system_get_reset_reason()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__hal__system.html#ga53ba6a7416574a1b03890d23b7a90264">cyhal_reset_reason_t</a> cyhal_system_get_reset_reason </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the cause of the latest reset or resets that occurred in the system. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns an enum of flags with the cause of the last reset(s)</dd></dl>
<p>Refer <a class="el" href="group__group__hal__system.html#subsection_system_snippet2">Snippet 2: Reset reason</a> for code snippet on cyhal_system_get_reset_reason </p>

</div>
</div>
<a id="ga9a935d5e4f43343e7bbb4f9a86a10df0" name="ga9a935d5e4f43343e7bbb4f9a86a10df0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9a935d5e4f43343e7bbb4f9a86a10df0">&#9670;&nbsp;</a></span>cyhal_system_clear_reset_reason()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_system_clear_reset_reason </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears the reset cause registers. </p>
<p >This should be done after calling <a class="el" href="group__group__hal__system.html#ga9a7b601e0b06a896860f411103a4abc6">cyhal_system_get_reset_reason</a> to make sure the reason does not persist between resets. </p>

</div>
</div>
<a id="ga85e89acd2a95fc589999ad9a6f20d48d" name="ga85e89acd2a95fc589999ad9a6f20d48d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga85e89acd2a95fc589999ad9a6f20d48d">&#9670;&nbsp;</a></span>cyhal_system_reset_device()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_system_reset_device </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Resets the device. </p>
<p >The mechanism used to reset the device is implementation-specific and the reset behavior differs between devices.</p>
<dl class="section return"><dt>Returns</dt><dd>This function does not return if successful. Otherwise an error is returned. </dd></dl>

</div>
</div>
<a id="ga208f2774fd0143000cea9e488035c337" name="ga208f2774fd0143000cea9e488035c337"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga208f2774fd0143000cea9e488035c337">&#9670;&nbsp;</a></span>cyhal_system_set_isr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_system_set_isr </td>
          <td>(</td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>irq_num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>irq_src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__system.html#gaa60625daf3efd10f83a90b0032b4a818">cyhal_irq_handler</a>&#160;</td>
          <td class="paramname"><em>handler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers the specified handler as the callback function for the specified irq_num with the given priority. </p>
<p >For devices that mux interrupt sources into mcu interrupts, the irq_src defines the source of the interrupt.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">irq_num</td><td>The MCU interrupt number to register the handler for. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">irq_src</td><td>The interrupt source that feeds the MCU interrupt. For devices that have a 1:1 mapping between interrupt sources and MCU interrupts this should be the same as the irq_num. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">priority</td><td>The MCU interrupt priority. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">handler</td><td>The function pointer to call when the interrupt is triggered. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns CY_RSLT_SUCCESS if the set_isr request was successful, otherwise an error </dd></dl>

</div>
</div>
<a id="ga2338e3ad7fac5762523f4f5c473c86a3" name="ga2338e3ad7fac5762523f4f5c473c86a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2338e3ad7fac5762523f4f5c473c86a3">&#9670;&nbsp;</a></span>cyhal_system_set_supply_voltage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_system_set_supply_voltage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__system.html#gafeea1420fd2da9fe4f00a182a083e57c">cyhal_system_voltage_supply_t</a>&#160;</td>
          <td class="paramname"><em>supply</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mvolts</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Informs the system of the current voltage level on the specified supply. </p>
<p >This is generally expected to be set once at system startup, but it may be set repeatedly during runtime if operating conditions change. Once set, this value can be queried via <a class="el" href="group__group__hal__system.html#ga1ceb538fd488a22132ab2153280ade6b">cyhal_system_get_supply_voltage</a>.</p>
<dl class="section note"><dt>Note</dt><dd>This only informs the system of the voltage level. It does not alter any of the device operating conditions.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">supply</td><td>The supply whose voltage is being specified. </td></tr>
    <tr><td class="paramname">mvolts</td><td>The voltage level on the specified supply, in millivolts. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1ceb538fd488a22132ab2153280ade6b" name="ga1ceb538fd488a22132ab2153280ade6b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1ceb538fd488a22132ab2153280ade6b">&#9670;&nbsp;</a></span>cyhal_system_get_supply_voltage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_system_get_supply_voltage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__system.html#gafeea1420fd2da9fe4f00a182a083e57c">cyhal_system_voltage_supply_t</a>&#160;</td>
          <td class="paramname"><em>supply</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the current voltage level on the specified supply, as set in <a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a>. </p>
<dl class="section note"><dt>Note</dt><dd>This only returns the value provided to <a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a>. It does not perform any measurements of the current supply level.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">supply</td><td>The supply whose voltage is being specified. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The voltage level on the specified supply, in millivolts. If the voltage has not been specified, returns 0. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
